package com.bt.dmdb.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.bt.dmdb.dao.CustomerDetailsDao;
import com.bt.dmdb.model.BusinessNature;
import com.bt.dmdb.model.BusinessNatureDto;
import com.bt.dmdb.model.Contact;
import com.bt.dmdb.model.ContactDto;
import com.bt.dmdb.model.EagPassiveIncome;
import com.bt.dmdb.model.ExchangeMarketDto;
import com.bt.dmdb.model.Locations;
import com.bt.dmdb.model.LocationsDto;
import com.bt.dmdb.model.Market;
import com.bt.dmdb.model.MemberStatus;
import com.bt.dmdb.model.MemberStatusDto;
import com.bt.dmdb.model.PassiveIncomeDto;
import com.bt.dmdb.model.Regulators;
import com.bt.dmdb.model.RegulatorsDto;
import com.bt.dmdb.model.RestrictedDistributor;
import com.bt.dmdb.model.RestrictedDistributorDto;
import com.bt.dmdb.model.SourceIncome;
import com.bt.dmdb.model.SourceIncomeDto;
import com.bt.dmdb.model.StocksDistribution;
import com.bt.dmdb.model.StocksDistributionDto;
import com.bt.dmdb.service.CustomerDetailsService;


@Service("customerDetailsService")
@Transactional(value = "txmDmdb")
public class CustomerDetailsServiceImpl implements CustomerDetailsService{

	@Resource
	private CustomerDetailsDao customerDetailsDao;

	public CustomerDetailsDao getCustomerDetailsDao() {
		return customerDetailsDao;
	}

	public void setCustomerDetailsDao(CustomerDetailsDao customerDetailsDao) {
		this.customerDetailsDao = customerDetailsDao;
	}
	
	//1st change - start
	@Override
    @Transactional(value = "txmDmdb", readOnly = true)
    public List<BusinessNature> getAllBusinessNature(Long id) {
        return customerDetailsDao.getAllBusinessNature(id);
    }

	@Override
	public void deleteBusinessNatureById(Long id) {
		customerDetailsDao.deleteBusinessNatureById(id);
		
	}

	@Override
	public List<BusinessNature> saveAllBusinessNature(BusinessNatureDto businessNatureDto) {
		return customerDetailsDao.saveAllBusinessNature(businessNatureDto);
	}
	
	
	@Override
	public List<MemberStatus> getAllEAGMemberStatus(Long id) {
		  return customerDetailsDao.getAllEAGMemberStatus(id);
	}

	@Override
	public void deleteEAGMemberStatusById(Long id) {
		customerDetailsDao.deleteEAGMemberStatusById(id);
		
	}

	@Override
	public List<MemberStatus> saveAllEAGMemberStatus(
			MemberStatusDto memberStatusDto) {
		return customerDetailsDao.saveAllEAGMemberStatus(memberStatusDto);
	}
	//1st change - end

	@Override
	public List<EagPassiveIncome> getAllEAGPassiveIncome(Long id) {
		// TODO Auto-generated method stub
		return customerDetailsDao.getAllEAGPassiveIncome(id);
	}

	@Override
	public void deleteEAGPassiveIncomeById(Long id) {
		// TODO Auto-generated method stub
		customerDetailsDao.deleteEAGPassiveIncomeById(id);
	}

	@Override
	public List<EagPassiveIncome> saveAllEAGPassiveIncome(
			PassiveIncomeDto passiveIncomeDto) {
		// TODO Auto-generated method stub
		return customerDetailsDao.saveAllEAGPassiveIncome(passiveIncomeDto);
	}

	@Override
	public List<Market> getAllExchangeMarket(Long id) {
		// TODO Auto-generated method stub
		return customerDetailsDao.getAllExchangeMarket(id);
	}

	@Override
	public void deleteExchangeMarketById(Long id) {
		// TODO Auto-generated method stub
		customerDetailsDao.deleteExchangeMarketById(id);
	}

	@Override
	public List<Market> saveAllExchangeMarket(
			ExchangeMarketDto exchangeMarketDto) {
		// TODO Auto-generated method stub
		return customerDetailsDao.saveAllExchangeMarket(exchangeMarketDto);
	}	


	@Override
	public List<Locations> getAllLocations(Long id) {
		// TODO Auto-generated method stub
		return customerDetailsDao.getAllLocations(id);
	}

	@Override
	public void deleteLocationsById(Long id) {
		// TODO Auto-generated method stub
		customerDetailsDao.deleteLocationsById(id);
	}

	@Override
	public List<Locations> saveAllLocations(
			LocationsDto locationsDto) {
		// TODO Auto-generated method stub
		return customerDetailsDao.saveAllLocations(locationsDto);
	}
	
	@Override
	public List<Regulators> getAllRegulators(Long id) {
		// TODO Auto-generated method stub
		return customerDetailsDao.getAllRegulators(id);
	}

	@Override
	public void deleteRegulatorsById(Long id) {
		// TODO Auto-generated method stub
		customerDetailsDao.deleteRegulatorsById(id);
	}

	@Override
	public List<Regulators> saveAllRegulators(
			RegulatorsDto regulatorsDto) {
		// TODO Auto-generated method stub
		return customerDetailsDao.saveAllRegulators(regulatorsDto);
	}
	
	@Override
	public List<RestrictedDistributor> getAllRestrictedDistributor(Long id) {
		// TODO Auto-generated method stub
		return customerDetailsDao.getAllRestrictedDistributor(id);
	}

	@Override
	public void deleteRestrictedDistributorById(Long id) {
		// TODO Auto-generated method stub
		customerDetailsDao.deleteRestrictedDistributorById(id);
	}

	@Override
	public List<RestrictedDistributor> saveAllRestrictedDistributor(
			RestrictedDistributorDto restrictedDistributorDto) {
		// TODO Auto-generated method stub
		return customerDetailsDao.saveAllRestrictedDistributor(restrictedDistributorDto);
	}
	
	@Override
	public List<SourceIncome> getAllSourceIncome(Long id) {
		// TODO Auto-generated method stub
		return customerDetailsDao.getAllSourceIncome(id);
	}

	@Override
	public void deleteSourceIncomeById(Long id) {
		// TODO Auto-generated method stub
		customerDetailsDao.deleteSourceIncomeById(id);
	}

	@Override
	public List<SourceIncome> saveAllSourceIncome(
			SourceIncomeDto sourceIncomeDto) {
		// TODO Auto-generated method stub
		return customerDetailsDao.saveAllSourceIncome(sourceIncomeDto);
	}
	
	@Override
	public List<StocksDistribution> getAllStocksDistribution(Long id) {
		// TODO Auto-generated method stub
		return customerDetailsDao.getAllStocksDistribution(id);
	}

	@Override
	public void deleteStocksDistributionById(Long id) {
		// TODO Auto-generated method stub
		customerDetailsDao.deleteStocksDistributionById(id);
	}

	@Override
	public List<StocksDistribution> saveAllStocksDistribution(
			StocksDistributionDto stocksDistributionDto) {
		// TODO Auto-generated method stub
		return customerDetailsDao.saveAllStocksDistribution(stocksDistributionDto);
	}


	@Override
	public List<Contact> getAllContacts(Long id) {
		return customerDetailsDao.getAllContacts(id);
	}

	@Override
	public void deleteContactById(Long id) {
		customerDetailsDao.deleteContactById(id);
	}

	@Override
	public List<Contact> saveAllContacts(ContactDto contactDto) {
		return customerDetailsDao.saveAllContacts(contactDto);
	}
}
